<!--
 * @author luguoxiang
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
-->
<template>
  <view class="lg-list-more">
    <template v-if="hasMore">
      <view v-if="loading">{{ loadingText || '正在加载数据' }}</view>
      <view v-else @click="loadMore">{{ hasMoreText || '上拉或点击加载更多' }}</view>
    </template>
    <view v-else>{{ noMoreText || '没有更多数据了' }}</view>
  </view>
</template>

<script setup lang="ts">

interface Props {
  hasMore?: boolean;
  loading?: boolean;
  hasMoreText?: string;
  loadingText?: string;
  noMoreText?: string;
}
const props = defineProps<Props>();
const emits = defineEmits(['loadMore']);

function loadMore() {
  emits('loadMore')
}
</script>
<script lang="ts">
export default {
  name: 'LgListMore'
}
</script>
<style lang="scss" scoped>
.lg-list-more {
  text-align: center;
  padding: 8rpx 0;
  color: #888;
}
</style>